App({
  onLaunch() {
    console.log('证件照小程序启动')
    
    // 检查更新
    const updateManager = wx.getUpdateManager()
    updateManager.onCheckForUpdate(function (res) {
      console.log(res.hasUpdate)
    })
    
    updateManager.onUpdateReady(function () {
      wx.showModal({
        title: '更新提示',
        content: '新版本已经准备好，是否重启应用？',
        success(res) {
          if (res.confirm) {
            updateManager.applyUpdate()
          }
        }
      })
    })
    
    // 获取系统信息
    wx.getSystemInfo({
      success: res => {
        this.globalData.systemInfo = res
      }
    })
  },
  
  globalData: {
    userInfo: null,
    systemInfo: null,
    apiBase: 'https://your-server.com/api',
    photoSpecs: [
      { id: 1, name: '1寸', width: 295, height: 413, ratio: '2:3' },
      { id: 2, name: '2寸', width: 413, height: 579, ratio: '2:3' },
      { id: 3, name: '小2寸', width: 413, height: 531, ratio: '3:4' },
      { id: 4, name: '护照', width: 354, height: 472, ratio: '3:4' },
      { id: 5, name: '签证', width: 413, height: 531, ratio: '3:4' }
    ],
    backgroundColors: [
      { id: 1, name: '白色', value: '#FFFFFF' },
      { id: 2, name: '蓝色', value: '#3B82F6' },
      { id: 3, name: '红色', value: '#EF4444' },
      { id: 4, name: '渐变蓝', value: 'linear-gradient(135deg, #667eea 0%, #764ba2 100%)' }
    ]
  }
})